function [ obj ] = evaluate_noise_latency(weight, idx, relevant_idx, target_hover_state, H, dt, model, K_ss)
%UNTITLED4 Summary of this function goes here
%   Detailed explanation goes here
basin = 15;

latency = 3;
du_window = zeros(length(idx.inputs), latency);
for i=1:latency+1
	x(:,i) = target_hover_state;
end
delta_u_que = zeros(length(idx.u_prev),latency);
for t=latency+1:H   
    delta_u = policy_linear_neural(weight, x(:,t-latency), target_hover_state, idx, K_ss);
    du_window(:,2:end) = du_window(:,1:end-1);
    du_window(:,1) = delta_u;
    noise_F_T = 0.1*randn(6,1);
    x(:,t+1) = f_heli(x(:,t), delta_u, dt, model, idx, noise_F_T);
    if(norm(x(idx.ned,t+1) - target_hover_state(idx.ned,:)) > basin)
        break;
    end
end


obj = t;

end

